#用两个栈分别存数字和运算符。
#遇到高优先级运算符（* /）直接计算，低优先级（+ -）暂存。
def simple_calculator(s):
    stack = []
    num = 0
    pre_op = '+'  # 默认第一个数为正数
    for i, c in enumerate(s):
        if c.isdigit():
            num = num * 10 + int(c)
        if (not c.isdigit() and c != ' ') or i == len(s) - 1:
            if pre_op == '+':
                stack.append(num)
            elif pre_op == '-':
                stack.append(-num)
            elif pre_op == '*':
                stack.append(stack.pop() * num)
            elif pre_op == '/':
                stack.append(int(stack.pop() / num))  # 整除处理
            pre_op = c
            num = 0
    return sum(stack)

# 测试
print(simple_calculator("3+5 * 2-6/3"))  # 输出: 11 (3 + 10 - 2)
